package demo11;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 */
class Calculator {
    public int add(int a, int b) {
        return a + b;
    }

    public double add(double a, double b) {
        return a + b;
    }
}
public class Test2 {
    public static void main(String[] args) {
        Calculator calc = new Calculator();
        System.out.println(calc.add(2, 3));      // 调用 int add(int, int)
        System.out.println(calc.add(2.5, 3.5)); // // 调用 double add(double, double)

    }
}
